/*
 * @Author: your name
 * @Date: 2022-04-21 22:15:18
 * @LastEditTime: 2022-11-22 16:24:28
 * @LastEditors: YNT 2501512800@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \22-03-19 智慧社区\api\topic.js
 */
import wxRequest from '../utils/wx-request'

class SpecialModel extends wxRequest {
  // 活动类型
  actTypeList() {
    return this.request({
      url: `/api/v1/activity/type`,
      method: 'GET',
    })
  }

  // 活动列表
  actTopicList(data) {
    return this.request({
      url: `/api/v1/activity/list`,
      method: 'GET',
      data,
    })
  }

  // 话题帖子详情
  topicArticleDetail(id) {
    return this.request({
      url: `/api/v1/activity?id=${id}`,
    })
  }

  // 帖子评论
  debate(data) {
    return this.request({
      url: `/api/v1/activity/comment`,
      method: 'POST',
      data,
    })
  }

  // 帖子点赞
  like(data) {
    return this.request({
      url: `/api/v1/activity/comment/like`,
      method: 'GET',
      data,
    })
  }

  // 活动报名
  signUp(id) {
    return this.request({
      url: `/api/v1/activity/get_sign_up?id=${id}`,
      method: 'GET',
    })
  }

  // 活动取消报名
  signCancel(id) {
    return this.request({
      url: `/api/v1/activity/get_sign_up_cancel?id=${id}`,
      method: 'GET',
    })
  }

  // 当前状态获取
  getStatus(data) {
    return this.request({
      url: `/api/v1/activity/qr_code`,
      method: 'POST',
      data,
    })
  }

  // 活动签到
  resister(id) {
    return this.request({
      url: `/api/v1/activity/get_sign_in?id=${id}`,
      method: 'GET',
    })
  }

  // 活动签退
  registerOut(id) {
    return this.request({
      url: `/api/v1/activity/get_sign_out?id=${id}`,
      method: 'GET',
    })
  }

  getActivtiyId(data) {
    return this.request({
      url: `/api/v1/activity/qr_code_id`,
      method: 'POST',
      data,
    })
  }
}

export default new SpecialModel()
